//
//  UIView+Util.h
//  Melinked
//
//  Created by peter on 15/4/2.
//  Copyright (c) 2015年 YEL. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIView+FliterKeyWords.h"
#import <UIImageView+WebCache.h>

typedef NS_OPTIONS(NSUInteger, BorderDirectionMark) {
    BorderDirectionLeft = 1<< 0,
    BorderDirectionRight = 1 << 1,
    BorderDirectionTop = 1 << 2,
    BorderDirecionBottom = 1 << 3,
    BorderDirectionALL = ~0UL,
};

@interface UIView (YWUtil)
@property(strong, nonatomic) UIViewController *addObserViewConstroller;
@property(assign, nonatomic) float cornerRadius;
@property(assign, nonatomic) CGFloat height;
@property(assign, nonatomic) CGFloat width;
@property(assign, nonatomic) CGFloat x;
@property(assign, nonatomic) CGFloat y;
@property (strong, nonatomic, readonly) CALayer *maskOpacityLayer;
@property(assign, nonatomic, getter=isMarked) BOOL marked;
@property(copy, nonatomic) void(^tapAction)(UIView *);
- (UIViewController *)nearestViewController;
- (void)clearSubViews;
- (void)configureRound;
- (void)reSetXCoords:(CGFloat)aCoords;
- (void)reSetYCoords:(CGFloat)aCoords;
- (void)reLayout:(CGSize)size;
- (void)reLayoutByWidth:(CGFloat)distance;
- (void)reLayoutByHeight:(CGFloat)distance;
- (void)tapUpWithBlock:(void(^)(UIView *))aBlock;
- (void)roundRadiusWithCorners:(UIRectCorner)corners radius:(CGFloat)radius fillColor:(UIColor *)fillColor strokeColor:(UIColor *)strokeColor;
- (void)rider_drawCornersRadius:(CGFloat)radius roundCorners:(UIRectCorner)corners;
- (void)roundBorderWithBorderDirection:(BorderDirectionMark)direction lineWidth:(CGFloat)lineWidth color:(UIColor *)color;

/**
 显示加载等待..
 */
- (void)showLoadingView;

/**
 隐藏加载等待..
 */
- (void)hiddenLoadingView;
@end
